package web

import (
	"ksd-social-api/commons/base/controller"
)

type NoteCategoryController struct {
	controller.BaseController
}

/**
 * @author feige
 * @date 2023-10-08
 * @desc 根据下载id查询明细
 * 访问1：https://www.kuangstudy.com/api/v1/note/detail?id=1384680735788535809?token=
 */
func (web *NoteCategoryController) FindCategories() {
	channelId, _ := web.ParseParamUint64("channelId")
	categories, err := noteCategoryService.FindCategories(channelId, web.GetSystemId())
	if err != nil {
		web.FailCodeMsg(controller.FAIL_CODE, "查询下载分类失败！")
	}
	web.Ok(categories)
}

/**
 * @author feige
 * @date 2023-10-08
 * @desc 根据下载id查询明细
 * 访问1：https://www.kuangstudy.com/api/v1/note/detail?id=1384680735788535809?token=
 */
func (web *NoteCategoryController) FindCategoriesAll() {
	categories, err := noteCategoryService.FindCategoriesAll(web.GetSystemId())
	if err != nil {
		web.FailCodeMsg(controller.FAIL_CODE, "查询下载分类失败！")
	}
	web.Ok(categories)
}
